package com.wynn.serviceFeign;


import com.wynn.Exception.MyException;
import com.wynn.pojo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.ServletContext;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@FeignClient("serviceProviderBase")
public interface PlanClient {

    @GetMapping("plan/chartData1")
    Result getChartData1();

    @GetMapping("plan/selectAll")
    List<PlanSummary> selectAll ();

    @PostMapping("plan/addPlan")
    void addPlan(PlanSummary planSummary) throws MyException;

    @PostMapping("plan/editPlan")
    void editPlan(PlanSummary planSummary);

    @PostMapping("plan/deletePlan")
    void deletePlan(PlanSummary planSummary);

    @PostMapping("plan/search")
    List<PlanSummary> search(ProductLine productLine, @RequestParam(value = "produceDate")Date produceDate);

    @PostMapping("plan/searchOnePlan")
    List<PlanSummary> searchOnePlan(ProductLine productLine, @RequestParam(value = "produceDate")Date produceDate);

    @PostMapping("plan/importPlan")
    void importPlan(ArrayList<ArrayList<String>> row,@RequestParam(value = "produceDate") Date produceDate);

    @PostMapping("plan/schedule")
    Schedule schedule(@RequestParam(value = "produceDate") Date produceDate, ProductLine productLine);

    @PostMapping("plan/calculation")
    void calculation (PlanSummary planSummary);

    @PostMapping("plan/calcuStatue")
    CalcuStatue calcuStatue(SearchPlan searchPlan);
}
